package stream;

import java.util.stream.Stream;

/*
终结方法（返回值不是Stream流对象）
1.forEach
2.count
 */
public class StreamDemo3 {
    public static void main(String[] args) {
        long count = Stream.of(1, 2, 3, 4, 5, 6).filter(s -> s % 2 == 0).count();
        System.out.println(count);

    }
}
